<%@ page contentType="text/html;charset=UTF-8"%>
<%@taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
<%@taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%>
<%@taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>
<%@page import="com.ufida.ebscg.comm.session.UserBean;"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7"/>
<title>平安银行供应商门户-采购创造价值-供应商自助_产品价格维护</title>
<link href="../css/style.css" rel="stylesheet" type="text/css" />
<link href="../css/style_add.css" rel="stylesheet" type="text/css" />
<link href="css/selfcss.css" rel="stylesheet" type="text/css" /></head>
<script language="JavaScript" type="text/javascript" src="../javascript/caltimer.js"></script>
<script language="JavaScript" type="text/javascript" src="../javascript/ajaxdeal.js"></script>
<body style="width:610px">
<div id="main">
<!--左侧内容开始-->

<!--右侧内容开始-->

<!--  <form action="ordercon.do" name="constratform" method="post">-->


<input type="hidden" name = "type" value = "3"/>

<div style="width:680px;overflow:auto;margin-left:20px" align="center">
<strong><span style="color:red;font-size:14px">${message}</span></strong>

<!-- 
<table width="610" border="0" cellpadding="0" cellspacing="0">
    <tr>
      <td><span class="f-12-4f4f4f">框架协议名称：</span><strong><span class="f-14-e57c00">${ct_title}</span></strong></td>
    </tr>
    
</table>
 -->
<logic:equal value="3" name="steptype">
<table width="680" border="0" cellpadding="0" cellspacing="0" >
   <tr>
   		<td style="width:680px;" align="right">
   		<form action="ordercon.do?type=5&pk_dd_order_main=${constrat.pk_dd_order_main}&steptype=${steptype}" method="post" name="downprice">
   			<img src="../images/con_print.jpg" width="60"  height="20" border="0"  onclick="submitMess()" style="cursor:hand"/>
   		</form>
   		</td>
   </tr>
</table>
</logic:equal>
 <table width="680" border="0" cellpadding="0" cellspacing="0" style="border:1px solid #7f98ae;table-layout:fixed" >
   <tr>
   		<td colspan="4">
   		
   		</td>
   </tr>
   <tr >
      <td colspan="4" align="center" style="border-bottom:1px solid #7f98ae;">
      	<strong>${headname}信息</strong>
      </td>
    </tr>
   
   
   <tr>
   
   	  <td align="left" style="font-weight:bold">订单编号：&nbsp;</td>
      <td align="left">${constrat.bill_no}</td>
      
      <td height="30" align="left" style="font-weight:bold">订单名称：&nbsp;</td>
      <td align="left">${constrat.order_name}</td>
   </tr>
   
   
   <tr>
   		<td align="left" style="font-weight:bold">采购方名称：&nbsp;</td>
      <td align="left">招商银行股份有限公司</td>
      
      <td height="30" align="left" style="font-weight:bold">供应商名称：&nbsp;</td>
      <td align="left">${constrat.pk_supplier }</td>
   </tr>
   
   
   <tr>
   	  <td align="left" style="font-weight:bold">订单金额：&nbsp;</td>
      <td align="left">${constrat.ct_amount }</td>
      <td height="30" align="left" style="font-weight:bold">币种：&nbsp;</td>
      <td align="left">${constrat.currency }</td>
   </tr>
   
   <tr >
      <td height="30" align="left" style="font-weight:bold">框架架协议编号：&nbsp;</td>
      <td align="left">${constrat.framework_accord_no}</td>
      <td align="left" style="font-weight:bold" >框架协议名称：&nbsp;</td>
      <td align="left">${constrat.zdy4 }</td>
    </tr>
   
    <tr >
      <td align="left" style="font-weight:bold" >下单人：&nbsp;</td>
      <td align="left">${constrat.operatorid}</td>
      <td height="30" align="left" style="font-weight:bold"  >下单人联系电话：&nbsp;</td>
      <td align="left">${constrat.receiver_phone }</td>
    </tr>
    
    <tr >
      <td align="left" style="font-weight:bold" >下单日期：&nbsp;</td>
      <td align="left">${constrat.pub_ts }</td>
      <td height="30" align="left" style="font-weight:bold">期望送货日期：&nbsp;</td>
      <td align="left">${constrat.send_date}</td>
    </tr>
    
    <tr >
      <td align="left" style="font-weight:bold" >发票抬头：&nbsp;</td>
      <td align="left">${constrat.invoice_name}</td>
      <td height="30" align="left" style="font-weight:bold">发票寄送地址：&nbsp;</td>
      <td align="left">${constrat.invoice_addr}</td>
    </tr>

    <tr >
      <td align="left" style="font-weight:bold" >紧急程度：&nbsp;</td>
      <td align="left">${constrat.turgency}</td>
      <td height="30" align="left" style="font-weight:bold">订单有效期：&nbsp;</td>
      <td align="left">${constrat.ct_closed_date}</td>
    </tr>
    <tr >
      <td align="left" style="font-weight:bold" >供应商联系人：&nbsp;</td>
      <td align="left">${constrat.supplier_contact}</td>
      <td height="30" align="left" style="font-weight:bold">供应商联系电话：&nbsp;</td>
      <td align="left">${constrat.supplier_telphone}</td>
    </tr>
    
    <tr >
      <td align="left" style="font-weight:bold" >开户行：&nbsp;</td>
      <td align="left">${constrat.sup_bank_name}</td>
      <td height="30" align="left" style="font-weight:bold">银行账号：&nbsp;</td>
      <td align="left">${constrat.sup_bank_no}</td>
    </tr>
    
    <tr >
      <td align="left" style="font-weight:bold" >供应商邮箱：&nbsp;</td>
      <td colspan="3" align="left">${constrat.sup_email}</td>
    </tr>
    
    <tr>
      <td align="left" style="font-weight:bold">付款方式：&nbsp;</td>
      <td height="30" colspan="3" align="left">${constrat.pay_way}</td>
    </tr>
    
    <tr>
      <td align="left" style="font-weight:bold">订单内容：&nbsp;</td>
      <td height="30" colspan="3" align="left">${constrat.tctrcontent}</td>
    </tr>
    <tr>
      <td align="left" style="font-weight:bold">备注：&nbsp;</td>
      <td height="30" colspan="3" align="left">${constrat.memo}</td>
    </tr>
  
  </table>
</div>

<div style="width:680px;overflow:auto;height:250px;margin-left:20px">
<span><strong class="f-13-b-2a6ca7">产品列表</strong></span>
<table width="1500px" border="0" cellpadding="0" cellspacing="0">
           <tr>
             <td  height="28" style = "width:100px" align="center"  background="../images/th_bgc.jpg"><span class="f-12-b-ffffff">产品编码</span></td>
         	 <td  height="28" style = "width:100px" align="center"  background="../images/th_bgc.jpg"><span class="f-12-b-ffffff">产品分类</span></td>
         	 <td  height="28" style = "width:150px" align="center"  background="../images/th_bgc.jpg"><span class="f-12-b-ffffff">产品/服务名称</span></td>
         	 <td  height="28" style = "width:150px" align="center"  background="../images/th_bgc.jpg"><span class="f-12-b-ffffff">型号</span></td>
         	 <td  height="28" style = "width:200px" align="center"  background="../images/th_bgc.jpg"><span class="f-12-b-ffffff">详细描述</span></td>
         	 <td  height="28" style = "width:80px" align="center"  background="../images/th_bgc.jpg"><span class="f-12-b-ffffff">数量</span></td>
         	 <td  height="28" style = "width:80px" align="center"  background="../images/th_bgc.jpg"><span class="f-12-b-ffffff">单位</span></td>
         	 <td  height="28" style = "width:100px" align="center"  background="../images/th_bgc.jpg"><span class="f-12-b-ffffff">单价</span></td>
         	 <td  height="28" style = "width:200px" align="center"  background="../images/th_bgc.jpg"><span class="f-12-b-ffffff">总金额</span></td>
         	 <td  height="28" width="340px" align="center"  background="../images/th_bgc.jpg"><span class="f-12-b-ffffff">备注</span></td>
          </tr>
          
          <logic:iterate id="item" name="itemfs">
          	<tr>
          	    <td  style = "width:100px" align="center">${item.prod_no }</td>
          		<td  style = "width:100px" align="center">${item.pk_da_prod_cate }</td>
          		<td  style = "width:150px" align="center">${item.prod_name }</td>
          		<td  align="center" style = "width:150px">${item.prod_model }</td>
          		<td  align="center" style = "width:200px">${item.prod_config_desc }</td>
          		<td  align="center" style = "width:80px">${item.purchase_quantity }</td>
          		<td  align="center" style = "width:80px">${item.unit }</td>
          		<td  align="center" style = "width:100px">${item.unit_price }</td>
          		<td  align="center" style = "width:200px">${item.amount }</td>
          		<td  align="center" style = "width:340px">${item.memo }</td>
          	</tr>
          	<tr>
         		<td colspan="10" height="1" bgcolor="#7f98ae"></td>
        	</tr>
          </logic:iterate>
          
</table>
</div>

 <div style="width:680px;overflow:auto;height:150px;margin-left:20px">
 <span><strong class="f-13-b-2a6ca7">附件信息</strong></span>
 <table width="680" border="0" cellpadding="0" cellspacing="0">
           <tr>
         	 <td  height="28" align="center"  background="../images/th_bgc.jpg" width="500"><span class="f-12-b-ffffff">附件名称</span></td>
         	 <td  height="28" align="center"  background="../images/th_bgc.jpg" width="110"><span class="f-12-b-ffffff">下载</span></td>
          </tr>
          
          <logic:iterate id="att" name="atts">
          
          	<tr>
          		<td  height="28" align="center" width="500" >${att.filename }</td>
          		<td  height="28" align="center" width="110" ><a href="ordercon.do?type=4&pk_da_att=${att.pk_da_att}" />下载</a></td>
          	</tr>
          	<tr>
         		<td colspan="2" height="1" bgcolor="#7f98ae"></td>
        	</tr>
          
          </logic:iterate>
          
</table>
</div>

<!-- 反馈说明 -->
 <div id="reme" style="width:680px;overflow:auto;height:350px;margin-left:20px">
 <span><strong class="f-13-b-2a6ca7">供应商反馈&nbsp;
 	<select id='fkstate' name="mySet" onchange="showSelectValue(this)">
      <option selected="selected" value="-1">--请选择--</option>
      <option value="1"
      <logic:equal value="1" name="constrat" property="fkstate">
		selected
	  </logic:equal>>已接受订单</option>
      <option value="2"
      <logic:equal value="2" name="constrat" property="fkstate">
		selected
	  </logic:equal>>已发货</option>
	  <option value="3"
      <logic:equal value="3" name="constrat" property="fkstate">
		selected
	  </logic:equal>>客户已签收</option>
	  <option value="4"
      <logic:equal value="4" name="constrat" property="fkstate">
		selected
	  </logic:equal>>拒绝订单</option>
	  <option value="5"
      <logic:equal value="5" name="constrat" property="fkstate">
		selected
	  </logic:equal>>其他</option>
    </select></strong></span><br/>
    <table width="700" border="0" cellpadding="0" cellspacing="0">
     <tr>
     	<td ><span id="cause" style="display:none;" ><strong class="f-13-b-2a6ca7">原因</strong></span></td>
     </tr>
     <tr>
     	<td ><textarea name="text" id='reason' cols="82" rows="3" style="display:none;" ></textarea></td>
     </tr>
    </table>
 <span><strong class="f-13-b-2a6ca7">反馈记录</strong></span>
<table width="700" border="0" cellpadding="0" cellspacing="0">
     <tr>
	    <td ><textarea readonly="readonly" name="memo" id="textarea2" cols="82" rows="5" >${constrat.sup_reverse}</textarea></td>
	 </tr>
</table>

<table width="680" border="0" cellpadding="0" cellspacing="0">
    <tr>
      <td width="300" height="40">&nbsp;</td>
      <td width="82"><a href="#"><img src="../images/botton_submit.jpg" width="60" height="20" border="0" style="cursor:hand" onclick="memosubmitValue()"/></a></td>
      <td width="102"><a href="#"></a></td>
      <td width="196">&nbsp;</td>
    </tr>
  </table>
</div>



<script language="javascript">
//隐藏掉当是普通、框架协议时候的框
var types = ${steptype};
if(types == 1 || types == 2){
	document.getElementById("reme").style.display="none";
}


function memosubmitValue()
{
	var record = document.getElementById('textarea2');
	var textobj=document.getElementById('reason');
	var selectvalue=document.getElementById('fkstate');
	var index = selectvalue.selectedIndex; // 选中索引
	if(selectvalue.value == -1){
		alert("请选择供应商反馈状态");
		return ;
	}else if((selectvalue.value=='4' || selectvalue.value=='5') && (textobj.value == '')){
		alert("请填写原因");
		return ;
	}
	
	var rowRocord = selectvalue.options[index].text + '    '+(new Date().toLocaleString().replace(/年|月/g,'-')).replace(/日/g,''); // 选中文本
	//记录本次反馈内容
	var curRocord = "";
	if(selectvalue.value=='4' || selectvalue.value=='5'){
		//反馈记录:含有原因  typeof textobj =="undefined"
		if(record.value == ""){
			record.value = rowRocord +'\n'+ '原因：'+textobj.value;
			curRocord = record.value;
		}else{
			record.value = record.value + '\n'+ rowRocord +'\n'+ '原因：'+textobj.value;
			curRocord = rowRocord +'\n'+ '原因：'+textobj.value;
		}
	}else{
		//反馈记录:不需要原因
		if(record.value == ""){
			record.value = rowRocord ;
			curRocord = rowRocord;
		}else{
			record.value = record.value + '\n'+ rowRocord ;
			curRocord = rowRocord;
		}
	}
	//转码，防止中文乱码
	var url = "ordercon.do?steptype=${steptype}&type=6&constratpk=${constrat.pk_dd_order_main}&memo="+encodeURI(encodeURI(curRocord))
			+"&selectvalue="+selectvalue.value;
	//parent.showHideFun();
	//parent.changeShowMessage("提交数据开始,请等待......");
	ajax(url,returnFunction);
}
function returnFunction(value)
{
	showmess("提交成功!");
	
	return 0;
	//parent.changeShowMessage("提交成功!",'yes','ok');
}

function submitMess(){
	document.downprice.submit();
}

function submitValue()
{
	document.constratform.submit();
}

function cancelValue()
{
	document.constratform.reset();
}


function calPriceAndTotal(index)
{

//目录单价
	var priceobj = document.all("cate_unit_price"+index);
//正折扣率
	var positive_discount = document.all("positive_discount"+index);
//折扣后单价
	var discounted_unit_price = document.all("discounted_unit_price"+index);

	if(priceobj != null && positive_discount != null)
	{
		var price = priceobj.value;
		var discount = positive_discount.value;
		var reg = /(^\d{1,8}$)|(^\d{1,8}\.\d{1,2}$)/;
		
		if(price != '' && discount != '')
		{
			if(!reg.test(price))
			{
				priceobj.value = '';
				return;
			}
			if(!reg.test(discount))
			{
				positive_discount.value = '';
				return;
			}
			
			var unitprice = parseFloat(price)*parseFloat(discount)/100;
			if(typeof(discounted_unit_price) == 'object')
			{
				var temp = new String(unitprice);
				
				if(!isNaN(temp))
				{
					if(temp.lastIndexOf(".") != -1)
					{
						discounted_unit_price.value = temp.substring(0,temp.lastIndexOf(".")+3);
					}else
					{
						discounted_unit_price.value  = temp;
					}
				}
			}
		}
	}
}
/**
 * 供应商反馈选定下拉时，触发的事件
 */
function showSelectValue(){
    var textobj=document.getElementById('reason');
    var causeobj = document.getElementById('cause');
    //var selectvalue=document.myForm.mySet.value; 
	var selectvalue=document.getElementById('fkstate').value;
    if(selectvalue=='4' || selectvalue=='5'){
       textobj.style.display="block";
       causeobj.style.display="block";
    }else{
       textobj.style.display="none";
       causeobj.style.display="none";
    } 
}
</script>
</div>
</body>
</html>
